Repository navigation
refactor(launchpad): use shared tooltip timing - #865
Conversation
1. Remove the launcher icon's local show timer. 2. Delegate hover timing and cancellation to PanelToolTip. Log: Use the shared tooltip delay for the launcher icon. Influence: Launcher and Dock tooltip delays match. refactor(launchpad): 复用任务栏提示计时 1. 移除启动器图标自己的显示计时器。 2. 将悬停计时和取消交给 PanelToolTip。 Log: 启动器图标使用任务栏的公共提示延时。 Influence: 启动器与任务栏的提示延时一致。 PMS: TASK-399397
Reviewer's GuideUIRemove the launcher icon’s local 50 ms tooltip timer and use PanelToolTip’s shared hover timing, while opening the tooltip at the launcher’s position and closing it when the pointer leaves.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="shell-launcher-applet/package/launcheritem.qml" line_range="514" />
<code_context>
- onTriggered: {
- var point = Applet.rootObject.mapToItem(null, Applet.rootObject.width / 2, Applet.rootObject.height / 2)
- toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height)
- toolTip.open()
- }
- }
</code_context>
<issue_to_address>
**Tooltip appears after right-click**
When the pointer is hovering over the icon and the user right-clicks before the shared tooltip delay expires, the right-button tap is accepted, but the handler only calls `toggleLauncher()` for left-button clicks and does not close or cancel the pending tooltip. `PanelToolTip.open()` therefore completes its delay and the tooltip appears after the right-click.
Cancel or close the pending tooltip when the handler accepts a right-button tap.
Also at `shell-launcher-applet/package/launcheritem.qml:515`.
</issue_to_address>
### Comment 2
<location path="shell-launcher-applet/package/launcheritem.qml" line_range="512-513" />
<code_context>
onHoveredChanged: {
if (hovered) {
- toolTipShowTimer.start()
+ const point = launcher.mapToItem(null, launcher.width / 2, launcher.height / 2)
+ toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height)
+ toolTip.open()
} else {
</code_context>
<issue_to_address>
**Tooltip appears at old position**
When the dock or launcher moves or resizes while the tooltip is waiting to open, the hover handler captures the launcher bounds before `PanelToolTip.open()` waits for the shared delay. The dock movement leaves `DockPanelPositioner.bounding` stale, so the tooltip appears at the launcher’s previous position.
Update `DockPanelPositioner.bounding` after the delay using the launcher’s current position and size.
</issue_to_address>| toolTipShowTimer.start() | ||
| const point = launcher.mapToItem(null, launcher.width / 2, launcher.height / 2) | ||
| toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height) | ||
| toolTip.open() |
There was a problem hiding this comment.
🟡 Medium · Tooltip appears after right-click
When the pointer is hovering over the icon and the user right-clicks before the shared tooltip delay expires, the right-button tap is accepted, but the handler only calls toggleLauncher() for left-button clicks and does not close or cancel the pending tooltip. PanelToolTip.open() therefore completes its delay and the tooltip appears after the right-click.
Cancel or close the pending tooltip when the handler accepts a right-button tap.
Also at shell-launcher-applet/package/launcheritem.qml:515.
Prompt for AI agents
In `shell-launcher-applet/package/launcheritem.qml` at line 514:
**Tooltip appears after right-click**
When the pointer is hovering over the icon and the user right-clicks before the shared tooltip delay expires, the right-button tap is accepted, but the handler only calls `toggleLauncher()` for left-button clicks and does not close or cancel the pending tooltip. `PanelToolTip.open()` therefore completes its delay and the tooltip appears after the right-click.
Cancel or close the pending tooltip when the handler accepts a right-button tap.
Also at `shell-launcher-applet/package/launcheritem.qml:515`.| const point = launcher.mapToItem(null, launcher.width / 2, launcher.height / 2) | ||
| toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height) |
There was a problem hiding this comment.
🟡 Medium · Tooltip appears at old position
When the dock or launcher moves or resizes while the tooltip is waiting to open, the hover handler captures the launcher bounds before PanelToolTip.open() waits for the shared delay. The dock movement leaves DockPanelPositioner.bounding stale, so the tooltip appears at the launcher’s previous position.
Update DockPanelPositioner.bounding after the delay using the launcher’s current position and size.
Prompt for AI agents
In `shell-launcher-applet/package/launcheritem.qml` at lines 512-513:
**Tooltip appears at old position**
When the dock or launcher moves or resizes while the tooltip is waiting to open, the hover handler captures the launcher bounds before `PanelToolTip.open()` waits for the shared delay. The dock movement leaves `DockPanelPositioner.bounding` stale, so the tooltip appears at the launcher’s previous position.
Update `DockPanelPositioner.bounding` after the delay using the launcher’s current position and size.|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
移除启动器图标自己的 50 毫秒提示计时器。悬停时由 PanelToolTip 按公共的 300 毫秒延时显示,指针离开或点击图标时取消待显示提示。
对应的 dde-shell PR:https://github.com/linuxdeepin/dde-shell/pull/1898。请先合入该 PR。
验证:启动器 QML 检查通过。
Summary by Sourcery
Enhancements:
PMS: TASK-399397